<article class="" id="post-">
<header class="entry-header">
<h1 class="entry-title">event.relatedTarget</h1>
<div class="entry-meta">
						所属分类：<span class="category"><a href="/category/events/">事件</a> &gt; <a href="/category/events/event-object/">事件对象</a></span>
<span class="pull-right">英文文档：<a href="https://api.jquery123.com/event.relatedTarget/" target="_blank">event.relatedTarget</a></span>
</div><!-- .entry-meta -->
</header><!-- .entry-header -->
<!-- .entry-header -->
<div class="entry-content">
<article class="entry property" id="event-relatedTarget1"><h2 class="section-title">
<span>event.relatedTarget</span><span class="returns">返回: <a href="/Types/#Element">Element</a></span>
</h2>
<div class="entry-wrapper">
<p class="desc"><strong>描述: </strong>在事件中涉及的其它任何DOM元素。</p>
<ul class="signatures"><li class="signature"><h4 class="name">
<span class="version-details">添加的版本: <a href="/category/version/1.1.4/">1.1.4</a></span>event.relatedTarget</h4></li></ul>
<div class="longdesc" id="entry-longdesc">
<p>对于 <code>mouseout</code> 事件，它指向被进入的元素；对于 <code>mouseover</code> 事件，它指向被离开的元素。</p>
</div>
<section class="entry-examples" id="entry-examples"><header><h2 class="underline">例子:</h2></header><div class="entry-example" id="example-0">
<h4><span class="desc">对于锚点的 mouseout 事件，显示被进入的元素类型。</span></h4>
<div class="syntaxhighlighter javascript ">
<table>
<tbody>
<tr>
<td class="gutter">
<div class="line n1">1</div>
<div class="line n2">2</div>
<div class="line n3">3</div>
</td>
<td class="code">
<pre><div class="container"><div class="line"><code>$(<span class="string">"a"</span>).mouseout(<span class="keyword">function</span>(event) {</code></div></div><div class="container"><div class="line"><code>  alert(event.relatedTarget.nodeName); <span class="comment">// "DIV"</span></code></div></div><div class="container"><div class="line"><code>});  </code></div></div></pre>
</td>
</tr>
</tbody>
</table>
</div>
</div></section>
</div></article> </div>
</article>